--#include "data\functions\Activity\Escort\Escort.lua" once
--极速押镖 - 目标NPC 

local npcId = 169
NpcDialog[npcId] = {}
local t = NpcDialog[npcId]

t.main = function(sysarg)
	local levelLimit = EscortConfig.level[2]
	local strColor1 = Lang.ScriptTips.Color_Greed
	if not Actor.checkActorLevel( sysarg, EscortConfig.level[2], EscortConfig.level[1] ) then
		strColor1 = Lang.ScriptTips.Color_Red
	end

	local strCond1 = string.format( Lang.ScriptTips.LevelLimitFormat, strColor1, levelLimit )
	local strCond  = strCond1

	local strDesc 		= Lang.ScriptTips.Escort008
	local okBtn 		= ""			--{按钮;样式;按钮名;函数名;描述}
	local strBtnList 	= ""
	okBtn1 		= "{btn;0;"..Lang.ScriptTips.Escort007..";%s;}"				--{按钮;样式;按钮名;函数名;描述}
	strBtnList 	= string.format(okBtn1, "GetEscortAward")

	-----------------
	local pack = DataPack.allocPacket(sysarg, LogicCmd.npcDialogSys.sysID, LogicCmd.npcDialogSys.sub.sNpcDlgData)
	
	DataPack.writeUint64(pack, Actor.getNpc(sysarg))
	DataPack.writeByte(pack, NpcDialogType.FYSDNpcDlg)
	DataPack.writeString(pack, strCond)
	DataPack.writeString(pack, strDesc)
	DataPack.writeString(pack, strBtnList)
	DataPack.writeChar(pack, -1)
	DataPack.writeByte(pack, 0);
	DataPack.flush(pack)

	return str
end


--进入副本
t.GetEscortAward = function ( sysarg )
	local state = HandinEscort(sysarg)
	if state then
		t.main(sysarg)
	end
end










	